import java.util.Scanner;

public class TenRandomNumsTest {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("Input the length of your array:");
        int length = sc.nextInt();
        int[]arr0 = new int[length];
        int max=0, min=99, sum=0, avg=0;
        for (int i = 0; i < arr0.length; i++) {
            arr0[i] = (int)(Math.random() * 90 + 10);
            System.out.print(arr0[i] + "\t");
            // max
            if (arr0[i] >= max){
                max = arr0[i];
            }
            // min
            if (arr0[i] <= min){
                min = arr0[i];
            }
            //sum
            sum += arr0[i];
        }
        avg = sum / arr0.length;
        System.out.println();
        System.out.println("Max = " + max + "\t Min = " + min + "\t Sum = " + sum + "\t Avg = " + avg);
    }
}
